package com.ibm.risk.irmp.base.service.client;

import com.ibm.risk.irmp.base.auth.service.IOrgUserBaseService;
import com.ibm.risk.irmp.common.auth.IUserService;
import com.ibm.risk.irmp.common.auth.vo.LoginUser;
import com.ibm.risk.irmp.common.auth.vo.OrgInfoVo;
import com.ibm.risk.irmp.common.auth.vo.UserInfoVo;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.service.annotation.GetExchange;
import org.springframework.web.service.annotation.HttpExchange;



@HttpExchange("/auth")
@Cacheable(cacheNames = "IrmpLoginDataCache", key = "'IOrgUserBaseService.' + methodName + args")
public interface UserBaseServiceClient extends IUserService, IOrgUserBaseService {

    @Override
    @GetExchange(value = "/login/users/sso")
    LoginUser getUserByUserSSOKey(@RequestParam("ssoKey") String ssoKey);
    @Override
    @GetExchange(value = "/login/users/{loginName}")
    LoginUser loadUserByUsername(@PathVariable("loginName") String userId);

    @Override
    @GetExchange("/org-user/biz-branches/{branchCode}")
    OrgInfoVo getBizOrgInfo(@PathVariable String branchCode);

    @Override
    @GetExchange("/org-user/mng-branches/{branchCode}")
    OrgInfoVo getMngOrgInfo(@PathVariable String branchCode);

    @Override
    @GetExchange("/org-user/user-infos/sn/{userSn}")
    UserInfoVo getUserInfoBySn(@PathVariable String userSn);

    @Override
    @GetExchange("/org-user/user-infos/{username}")
    UserInfoVo getUserInfoByUserName(@PathVariable String username);
}
